﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace iSteam.Sdk.SmartObjects
{
    public class iBase
    {
        private SteamToken _token;
        private Core _core;
        private readonly string _steamId;

        public iBase(SteamToken token)
        {
            _token = token;
            _core = new Core(token.AccessToken, token.LoginToken);
            _steamId = token.LoginToken.SteamId;
        }

        public iBase(SteamToken token, String steamId)
        {
            _token = token;
            _core = new Core(token.AccessToken, token.LoginToken);
            _steamId = steamId;
        }

        internal Core Core
        {
            get { return _core; }
        }

        public SteamToken Token
        {
            get { return _token; }
            set
            {
                _token = value;
                _core = new Core(_token.AccessToken, _token.LoginToken);
            }
        }

        public string SteamId
        {
            get { return _steamId; }
        }

        public iGroup GetGroup(string steamId)
        {
            return new iGroup(_token, steamId);
        }

        public iUser GetUser(string steamId)
        {
            return new iUser(_token, steamId);
        }
    }
}